package tests;

import tester.Example;
import tester.TestMethod;
import tester.Tester;
import tests.pojos.Address;
import tests.pojos.Person;

@Example
public class AddressTests {

	private Address address1;
	private Address address2;
	private Address address3;
	private Person person1;
	private Person person2;
	private Person person3;

	public void init(){
		address1 = new Address(203, "Boston Ave", "Medford", 02155, "MA");
		address2 = new Address(815, "N. Broadway", 
				"Saratoga Springs", 12866, "NY");
		address3 = new Address(118, "Derwyn Del Way", "Granville", 43023, "OH");
		person1 = new Person("Weston Jossey", 23, address1);
		person2 = new Person("Dave Baker", 23, address2);
		person3 = new Person("Russell Jossey", 5, address3);
	}
	
	@TestMethod
	public void tests(Tester t){
		init();
		t.checkExpect(address1.isResidentOf("MA"), true);
		t.checkExpect(address1.isResidentOf("OH"), false);
		t.checkExpect(person1.isOfAge(), true);
		t.checkExpect(person2.isOfAge(), true);
		t.checkExpect(person3.isOfAge(), false);
	}
	
}
